package com.example.shop.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
//import io.swagger.annotations.ApiModel;
//import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @projectName: travel
 * @package: com.example.travel.domain
 * @className: User
 * @author: Liqian
 * @description: TODO
 * @date: 2024/4/9 22:32
 * @version: 1.0
 */
//@ApiModel(value = "用户表单对象", description = "用户表单对象")
@Data
@TableName("t_user")
public class User {

    @TableId(type = IdType.AUTO)
    private Integer id;

    //    @ApiModelProperty(value = "用户名", required = true, example = "root")
    private String username;

    //    @ApiModelProperty(value = "密码", required = true, example = "root")
    @JsonIgnore
    private String password;
    //验证码
    @TableField(exist = false)
    private String captcha;

    @NotEmpty
    @Pattern(regexp = "^\\S{1,10}$")
    private String nickname;

    private String userPic;

    private String contact;
    private String role;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}





